﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.AutoMapper;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus;
using Volo.Abp.Identity;
using Volo.Abp.Modularity;

namespace Niti.OrderManage
{
    [DependsOn(
        typeof(AbpIdentityApplicationModule),
       typeof(AbpAutoMapperModule)
    )]
    public class NitiOrderMangeApplicationModule:AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            //配置验证
            Configure<AbpAutoMapperOptions>(options => {
                options.AddMaps<NitiOrderMangeApplicationModule>(validate: true);
                options.AddProfile<NitiAutoMapperProfile>(validate: true);
            });

          
        }

        //启用异常处理
        public override void PreConfigureServices(ServiceConfigurationContext context)
        {
            PreConfigure<AbpEventBusOptions>(options =>
            {
                //options.UseRetryStrategy();
                options.UseRetryStrategy(retryStrategyOptions =>
                {
                    retryStrategyOptions.IntervalMillisecond = 0;
                    retryStrategyOptions.MaxRetryAttempts = 1;
                });
               // options.ErrorHandleSelector = type => type == typeof(MyExceptionHandleEventData);
            });
        }


    }
}
